<template>
    <div class="classInformation">
        <div class="currentPosition clearFix">
            <div class="tips">
                <label>当前位置：</label>
            </div>
            <div class="current">
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/' }">班级首页</el-breadcrumb-item>
                    <el-breadcrumb-item>班级资讯</el-breadcrumb-item>
                    <el-breadcrumb-item>{{position}}</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
        </div>

        <el-container>
            <el-aside class="leftBox">
                <el-menu
                        :default-active="activeIndex"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose"
                        :router="true">
                    <el-menu-item index="classBulletin">
                        <span slot="title">班级公告</span>
                    </el-menu-item>
                    <el-menu-item index="classNews">
                        <span slot="title">班级新闻</span>
                    </el-menu-item>
                </el-menu>
            </el-aside>
            <el-main class="mainBox">
                <router-view />
            </el-main>
        </el-container>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                position:"班级公告",
                activeIndex:'classBulletin'
            }
        },
        mounted() {
            this.activeIndex =  this.$route.fullPath.substring(this.$route.fullPath.lastIndexOf('/')+1)
        },
        methods: {
            handleOpen(key, keyPath) {
                // console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                // console.log(key, keyPath);
            }
        }
    }
</script>

<style lang="scss" scoped>
.classInformation{
    .currentPosition{
        margin-top: 20px;
        font-size: 14px;
        color: #303133;
        .tips,.current{
            float: left;
        }
        .current{
            margin-top: 3px;
        }
    }

    .leftBox{
        padding: 20px 0;
    }

    .mainBox{
        padding: 20px 0 20px 20px;
    }

    .clearFix::after{
        content: "";
        display: block;
        width: 100%;
        font-size: 0;
        clear: both;
    }
}
</style>